package com.ruoyi.credential.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.credential.mapper.KwCredentialAccessMapper;
import com.ruoyi.credential.domain.KwCredentialAccess;
import com.ruoyi.credential.service.IKwCredentialAccessService;

/**
 * 密码箱凭证关联资源表Service业务层处理
 * 
 * @author gonianer
 * @date 2023-11-16
 */
@Service
public class KwCredentialAccessServiceImpl implements IKwCredentialAccessService 
{
    @Autowired
    private KwCredentialAccessMapper kwCredentialAccessMapper;

    /**
     * 查询密码箱凭证关联资源表
     * 
     * @param id 密码箱凭证关联资源表主键
     * @return 密码箱凭证关联资源表
     */
    @Override
    public KwCredentialAccess selectKwCredentialAccessById(Long id)
    {
        return kwCredentialAccessMapper.selectKwCredentialAccessById(id);
    }

    /**
     * 查询密码箱凭证关联资源表列表
     * 
     * @param kwCredentialAccess 密码箱凭证关联资源表
     * @return 密码箱凭证关联资源表
     */
    @Override
    public List<KwCredentialAccess> selectKwCredentialAccessList(KwCredentialAccess kwCredentialAccess)
    {
        return kwCredentialAccessMapper.selectKwCredentialAccessList(kwCredentialAccess);
    }

    /**
     * 新增密码箱凭证关联资源表
     * 
     * @param kwCredentialAccess 密码箱凭证关联资源表
     * @return 结果
     */
    @Override
    public int insertKwCredentialAccess(KwCredentialAccess kwCredentialAccess)
    {
        kwCredentialAccess.setCreateTime(DateUtils.getNowDate());
        return kwCredentialAccessMapper.insertKwCredentialAccess(kwCredentialAccess);
    }

    /**
     * 修改密码箱凭证关联资源表
     * 
     * @param kwCredentialAccess 密码箱凭证关联资源表
     * @return 结果
     */
    @Override
    public int updateKwCredentialAccess(KwCredentialAccess kwCredentialAccess)
    {
        kwCredentialAccess.setUpdateTime(DateUtils.getNowDate());
        return kwCredentialAccessMapper.updateKwCredentialAccess(kwCredentialAccess);
    }

    /**
     * 批量删除密码箱凭证关联资源表
     * 
     * @param ids 需要删除的密码箱凭证关联资源表主键
     * @return 结果
     */
    @Override
    public int deleteKwCredentialAccessByIds(Long[] ids)
    {
        return kwCredentialAccessMapper.deleteKwCredentialAccessByIds(ids);
    }

    /**
     * 删除密码箱凭证关联资源表信息
     * 
     * @param id 密码箱凭证关联资源表主键
     * @return 结果
     */
    @Override
    public int deleteKwCredentialAccessById(Long id)
    {
        return kwCredentialAccessMapper.deleteKwCredentialAccessById(id);
    }
}
